package com.xmg.server.goods.service.impl;

import com.xmg.server.goods.mapper.ProductImageMapper;
import com.xmg.shop.api.domain.ProductImage;
import com.xmg.shop.api.service.IProductImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by lenovo on 2017/11/16.
 */
@Service
public class ProductImageServiceImpl implements IProductImageService {
    @Autowired
    private ProductImageMapper productImageMapper;


    @Override
    public int deleteByPrimaryKey(Long id) {
        return productImageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int save(ProductImage record) {
        return productImageMapper.insert(record);
    }

    @Override
    public ProductImage selectByPrimaryKey(Long id) {
        return productImageMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ProductImage> selectAll() {
        return productImageMapper.selectAll();
    }

    @Override
    public List<ProductImage> getImageByProductId(Long productId) {
        return productImageMapper.getImageByProductId(productId);
    }
}
